package cn.sibu.plugin.authorize.util;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 刘红亮 on 2015/5/29 11:37
 */
public class ActivityLifeCycle {
    static List<Activity>  activities=new ArrayList<Activity>();

    public static void addActivity(Activity activity){
        activities.add(activity);
        L.e("size=" + activities.size());
    }
    public static void romoveActivity(Activity activity){
        activities.remove(activity);
        activity.finish();
    }
    public static void removeAllActivity(){
        for (Activity activity:activities){
            activity.finish();
        }
        activities.clear();
    }


    public static void exit(){
        for (Activity activity:activities){
           activity.finish();
        }
        System.exit(0);
        activities.clear();
    }


}
